//test07_BOM
var tm = new Date();
let week = tm.getDay();         // 星期
let day = tm.getDate();         // 日期

day = day < 10 ? "0" + day : day;

var str = "一二三四五六";    // 阿拉伯数字转换为汉字

let cald = document.querySelector("#cald");
let clock = document.querySelector("#clock");
let label1 = document.createElement("label");
let label2 = document.createElement("div");
let label3 = document.querySelector(".label3");
label1.style.color = "#fff";
label1.style.fontSize = "19px";
// console.log(week);
label1.innerHTML = week != 0 ? "星期" + str[week - 1] : "星期" + "日";   // 把阿拉伯数字转换成汉字
// label1.innerHTML = "星期" + str[week - 1];
cald.appendChild(label1);
label2.style.fontSize = "80px";
label2.style.color = "#000";
label2.innerHTML = day;
cald.appendChild(label2);

function changeTime() {
    let tm = new Date();
    let hours = tm.getHours();      // 小时
    let minutes = tm.getMinutes();  // 分钟
    let seconds = tm.getSeconds();  // 秒钟
    hours = hours < 10 ? "0" + hours : hours;
    minutes = minutes < 10 ? "0" + minutes : minutes;
    seconds = seconds < 10 ? "0" + seconds : seconds;
    label3.innerHTML = hours + ":" + minutes + ":" + seconds;
    setTimeout(changeTime,1000);
}
changeTime();